<?xml version="1.0" ?>
<lz:project xmlns:lz="http://schemas.icitadel.com/Lazarus/Source.xsd"
	name="Lazarus" namespace="OR.Lazarus" owner="dbo" user="jmuharsky" namespaceprefix="lzc" namespaceuri="http://schemas.icitadel.com/Lazarus/Compiled.xsd" businessconcept="Compiled">
	<lz:description>Lazarus Model - Compiled</lz:description>
	<lz:datasource location="WARREN" schema="Lazarus" user="gkirrel" password="hcccc.be1" />
	<lz:defaults>
		<lz:fields>
			<lz:field name="Name" alias="name" type="Varchar" size="100">
				<lz:indexes>
					<lz:index type="Primary" />
				</lz:indexes>
			</lz:field>
			<lz:field name="Description" type="Text" />
		</lz:fields>
	</lz:defaults>
   <lz:objects>
      
      <!-- Project System -->
      <lz:object name="Project" alias="project" title-field="Name">
         <lz:description>Defines a single group of related data components.</lz:description>
         <lz:fields>
            <lz:field name="Owner" type="Varchar" size="255" />
            <lz:field name="User" type="Varchar" size="255" />
            <lz:field name="DefaultNamespace" type="Varchar" size="255" />
            <lz:field name="NamespacePrefix" type="Varchar" size="255" />
            <lz:field name="NamespaceURI" alias="namespaceuri" type="Varchar" size="255" />
            <lz:field name="BusinessConcept" type="Varchar" size="255" />
            <lz:field name="DataSource">
               <lz:indexes>
                  <lz:index type="Foreign" object="DataSource" />
               </lz:indexes>
            </lz:field>
            <lz:field name="Security" alias="security" >
               <lz:indexes>
                  <lz:index type="Foreign" object="Security" accessor="security" />
               </lz:indexes>
            </lz:field>
         </lz:fields>
         <lz:collections>
            <lz:collection name="Objects" object="Object" />
            <lz:collection name="Tables" object="Table" />
            <lz:collection name="Packages" object="Package" />
            <lz:collection name="BusinessViews" object="BusinessView" />
         </lz:collections>
      </lz:object>

      <!-- DataSource System -->
      <lz:object name="DataSource" alias="datasource">
         <lz:description>Describes fields that will be included in all entities.</lz:description>
         <lz:fields>
            <lz:field name="Location" type="Varchar" size="255" />
            <lz:field name="Schema" type="Varchar" size="255" />
            <lz:field name="User" type="Varchar" size="255" />
            <lz:field name="Password" type="Varchar" size="255" />
         </lz:fields>
      </lz:object>
      <!-- End DataSource System -->

      <!-- Security System -->
      <lz:object name="Security" alias="security" title-field="Name">
         <lz:description>Defines the roles and users in the system.</lz:description>
         <lz:collections>
            <lz:collection name="Roles" object="Role" />
            <lz:collection name="Users" object="User" />
         </lz:collections>
      </lz:object>

      <lz:object name="User" alias="user" title-field="Name">
         <lz:description>Defines a user, which may be a database-internal user, or a Windows Security User.  As user may be a member of many roles.</lz:description>
         <lz:fields>
            <lz:field name="Type" alias="user-type" type="Varchar" size="255" />
            <lz:field name="Password" alias="password" type="Varchar" size="255" />
            <lz:field name="Notes" alias="notes" type="Varchar" size="255" />
         </lz:fields>
         <lz:collections>
            <lz:collection name="Roles" object="Role" />
         </lz:collections>
      </lz:object>

      <lz:object name="Permission" alias="permission" title-field="Name">
         <lz:description>Defines a set of capabilities allowed to a role.</lz:description>
         <lz:fields>
            <lz:field name="Role" alias="role" type="Varchar" size="100" />
         </lz:fields>
         <lz:collections>
            <lz:collection name="Capabilities" object="Capability" />
         </lz:collections>
      </lz:object>

      <lz:object name="Capability" alias="capability" title-field="Name">
         <lz:description>Defines a specific capability granted in a permission.</lz:description>
      </lz:object>

      <lz:object name="Role" alias="role" title-field="Name">
         <lz:description>Defines a specific role, which may be a database-internal role, or a Windows Security Group.</lz:description>
         <lz:fields>
            <lz:field name="Type" alias="role-type" type="Varchar" size="255" />
         </lz:fields>
      </lz:object>
      <!-- End Security System -->

      <!-- Object System -->
      <lz:object name="Object" alias="object" title-field="Name">
         <lz:description>Defines a class, with fields and methods.</lz:description>
         <lz:fields>
            <lz:field name="Alias" type="Varchar" size="255" />
            <lz:field name="Type" type="Varchar" size="255" />
            <lz:field name="Filename" type="Varchar" size="255" />
            <lz:field name="Namespace" type="Varchar" size="255" />
            <lz:field name="FriendlyName" alias="friendly-name" type="Varchar" size="255" />
            <lz:field name="LogicalName" alias="logical-name" type="Varchar" size="255" />
            <lz:field name="Filegroup" alias="filegroup" type="Varchar" size="255" />
            <lz:field name="DBTable" alias="db-table" type="Varchar" size="255" />
            <lz:field name="TitleField" alias="title-field" type="Varchar" size="255" />
         </lz:fields>
         <lz:collections>
            <lz:collection name="Fields" object="Field" />
            <lz:collection name="Methods" object="Method" />
            <lz:collection name="Views" object="View" />
            <lz:collection name="Implements" object="Implement" />
            <lz:collection name="Collections" object="Collection" />
            <lz:collection name="Permissions" object="Permission" />
            <lz:collection name="AllFields" alias="all-fields" object="ObjectRef" />
            <lz:collection name="Flags" object="AttributeFlag" />
            <lz:collection name="InitialData" alias="initial-data" object="DataRow" />
         </lz:collections>
      </lz:object>

      <lz:object name="AttributeFlag" alias="flag">
         <lz:description>Provides a custom name/value pair for defining metadata.  Currently supported on entities.</lz:description>
         <lz:fields>
            <lz:field name="Name" type="Varchar" size="255" required="true" />
            <lz:field name="Value" type="Varchar" size="255" required="true" />
         </lz:fields>
      </lz:object>

      <lz:object name="Implement" alias="implement" title-field="Name">
         <lz:description>Defines an implementation of an existing object's definition.</lz:description>
         <lz:fields>
            <lz:field name="Ref" alias="ref" type="Varchar" size="255" />
         </lz:fields>
      </lz:object>

      <lz:object name="DataRow" alias="data-row">
         <lz:description>Defines a set of data used for Initial Data processing.</lz:description>
         <lz:collections>
            <lz:collection name="DataValues" alias="data-values" object="DataValue" />
         </lz:collections>
      </lz:object>

      <lz:object name="DataValue" alias="data-value">
         <lz:description>Defines a value within a DataRow for a specific Field.</lz:description>
         <lz:fields>
            <lz:field name="Field" type="Varchar" size="255" required="true" />
            <lz:field name="Value" type="Varchar" size="4000" required="true" />
         </lz:fields>
      </lz:object>

      <lz:object name="ObjectRef" alias="object-ref" title-field="Name">
         <lz:description>Defines a reference to an object, and contains fields inherited from that object.</lz:description>
         <lz:fields>
            <lz:field name="Ref" type="Varchar" size="255" />
         </lz:fields>
         <lz:collections>
            <lz:collection name="Fields" object="Field" />
         </lz:collections>
      </lz:object>
      <!-- End Object System -->

      <!-- Package System -->
      <lz:object name="Package" alias="package" title-field="Name">
         <lz:description>Defines a container for methods that are non-contextual.</lz:description>
         <lz:collections>
            <lz:collection name="Methods" object="Method" />
         </lz:collections>
      </lz:object>
      <!-- End Package System -->

      <!-- Table System -->
      <lz:object name="Table" alias="table" title-field="Name">
         <lz:description>Defines a class, with fields and methods.</lz:description>
         <lz:fields>
            <lz:field name="Alias" type="Varchar" size="255" />
            <lz:field name="Type" type="Varchar" size="255" />
            <lz:field name="Filename" type="Varchar" size="255" />
            <lz:field name="Namespace" type="Varchar" size="255" />
            <lz:field name="FriendlyName" alias="friendly-name" type="Varchar" size="255" />
            <lz:field name="LogicalName" alias="logical-name" type="Varchar" size="255" />
            <lz:field name="Filegroup" alias="filegroup" type="Varchar" size="255" />
         </lz:fields>
         <lz:collections>
            <!--				<lz:collection name="DependencyChain" object="Table" /> -->
            <lz:collection name="Fields" object="Field" />
            <lz:collection name="Methods" object="Method" />
            <lz:collection name="Views" object="View" />
            <lz:collection name="Implements" object="Implement" />
            <lz:collection name="Permissions" object="Permission" />
            <lz:collection name="AllFields" alias="all-fields" object="TableRef" />
         </lz:collections>
      </lz:object>

      <lz:object name="TableRef" alias="table-ref" title-field="Name">
         <lz:description>Defines a reference to an table, and contains fields inherited from that table.</lz:description>
         <lz:fields>
            <lz:field name="Ref" type="Varchar" size="255" />
         </lz:fields>
         <lz:collections>
            <lz:collection name="Fields" object="Field" />
         </lz:collections>
      </lz:object>

      <lz:object name="View" alias="view" title-field="Name">
         <lz:description>Defines a view of an object.</lz:description>
         <lz:fields>
            <lz:field name="Alias" type="Varchar" size="255" />
            <lz:field name="Filename" type="Varchar" size="255" />
            <lz:field name="Filegroup" alias="filegroup" type="Varchar" size="255" />
         </lz:fields>
      </lz:object>
      <!-- End Table System -->

      <!-- Collection System -->
      <lz:object name="Collection" alias="collection" title-field="Name">
         <lz:description>Defines a collection of a single type of entity (and it's descendants).</lz:description>
         <lz:fields>
            <lz:field name="Alias" type="Varchar" size="255">
               <lz:description>Defines the XML Element name for the collection.</lz:description>
            </lz:field>
            <lz:field name="BindingObject" alias="binding-object" type="Varchar" size="255">
               <lz:description>Specifies the Object that contains the collection references.  This will default to the Object, but should be specified if an Intersection is being used.</lz:description>
            </lz:field>
            <lz:field name="BindingField" alias="binding-field" type="Varchar" size="255">
               <lz:description>Specifies the FK value in the Binding Object that relates back to the current Collection.</lz:description>
            </lz:field>
            <lz:field name="Object" type="Varchar" size="255">
               <lz:description>Specifies what entity the collection is comprised of.</lz:description>
            </lz:field>
            <lz:field name="Filename" type="Varchar" size="255">
               <lz:description>Specifies the base filename for the Collection.</lz:description>
            </lz:field>
         </lz:fields>
      </lz:object>
      <!-- End Collection System -->

      <!-- Field System -->
      <lz:object name="Field" alias="field" title-field="Name">
         <lz:description>Defines field storage within an Object.</lz:description>
         <lz:fields>
            <lz:field name="Alias" type="Varchar" size="255" />
            <lz:field name="AutoGenerate" type="Bit" required="true" default="false" />
            <lz:field name="DataType" alias="type" type="Varchar" size="255" />
            <lz:field name="DefaultValue" alias="default" type="Varchar" size="255" />
            <lz:field name="FriendlyName" alias="friendly-name" type="Varchar" size="255" />
            <lz:field name="ReadOnly" type="Bit" required="true" default="false" />
            <lz:field name="Required" type="Bit" required="true" default="false" />
            <lz:field name="Scale" type="Int" />
            <lz:field name="Size" type="Int" />
            <lz:field name="TableOnly" type="Bit" required="true" default="false" />
            <lz:field name="LogicalName" alias="logical-name" type="Varchar" size="255" />
            <lz:field name="DBName" type="Varchar" size="255" />
            <lz:field name="DBType" type="Varchar" size="255" />
         </lz:fields>
         <lz:collections>
            <lz:collection name="Constraints" object="Constraint" />
            <lz:collection name="Indexes" object="Index" />
         </lz:collections>
      </lz:object>

      <lz:object name="Constraint">
         <lz:description>Defines a constraint on a field.  This limits the set of valid values.</lz:description>
         <lz:fields>
            <lz:field name="Modifier" type="Varchar" size="255" />
            <lz:field name="Operation" type="Varchar" size="255" />
            <lz:field name="Value" type="Varchar" size="255" />
            <lz:field name="MinValue" alias="min-value" type="Varchar" size="255" />
            <lz:field name="MaxValue" alias="max-value" type="Varchar" size="255" />
         </lz:fields>
         <lz:collections>
            <lz:collection name="Values" alias="constraint-values" object="ConstraintValue" />
         </lz:collections>
      </lz:object>

      <lz:object name="ConstraintValue" alias="constraint-value">
         <lz:description>Defines a particular value used in an IN operation of a Constraint.</lz:description>
         <lz:fields>
            <lz:field name="Value" type="Varchar" size="255" />
         </lz:fields>
      </lz:object>

      <lz:object name="Index" alias="index" title-field="Name">
         <lz:description>Defines an index on a field.  This is used for PK determination, as well as database performance.</lz:description>
         <lz:fields>
            <lz:field name="Alias" type="Varchar" size="255" />
            <lz:field name="Accessor" type="Varchar" size="255" />
            <lz:field name="Object" type="Varchar" size="255" />
            <lz:field name="Type" type="Varchar" size="255" />
            <lz:field name="OwnerField" type="Varchar" size="255" />
            <lz:field name="Filegroup" alias="filegroup" type="Varchar" size="255" />
            <lz:field name="ConstraintName" type="Varchar" size="255" />
            <lz:field name="CascadeDelete" alias="cascade-delete" type="Bit" required="true" default="false" />
         </lz:fields>
      </lz:object>
      <!-- End Field System -->

      <!-- Method System -->
      <lz:object name="Method" alias="method" title-field="Name">
         <lz:description>Defines a method on an object.  Currently supported method types are Create, Update, Get and List.</lz:description>
         <lz:fields>
            <lz:field name="ObjectName" alias="object-name" type="Varchar" size="255">
               <lz:description>Defines an the method's name when used as an object method (in OOP, Customer.Create).</lz:description>
            </lz:field>
            <lz:field name="DBName" alias="db-name" type="Varchar" size="255">
               <lz:description>Defines an the method's name when used as a non-structured method (in SQL, CustomerCreate).</lz:description>
            </lz:field>
            <lz:field name="MethodType" type="Varchar" size="255" />
            <lz:field name="Filter" type="Varchar" size="255" />
            <lz:field name="Filename" type="Varchar" size="255" />
         </lz:fields>
         <lz:collections>
            <lz:collection name="Parameters" alias="method-params" object="Parameter" />
            <lz:collection name="Filters" alias="method-filters" object="Filter" />
            <lz:collection name="AffectedObjects" alias="method-effects" object="EffectObjectRef" />
            <lz:collection name="ResultObjects" alias="method-results" object="ResultObjectRef" />
            <lz:collection name="Permissions" object="Permission" />
         </lz:collections>
      </lz:object>

      <lz:object name="Parameter" alias="method-param" title-field="Name">
         <lz:description>Defines the parameters within a method.</lz:description>
         <lz:fields>
            <lz:field name="DBName" type="Varchar" size="255" />
            <lz:field name="Type" type="Varchar" size="255" />
            <lz:field name="Size" type="Int" />
            <lz:field name="Scale" type="Int" />
            <lz:field name="Required" type="Bit" />
            <lz:field name="Direction" type="Varchar" size="255" />
         </lz:fields>
      </lz:object>

      <lz:object name="ResultObjectRef" alias="object-ref" title-field="Name">
         <lz:description>Defines a set of objects that are returned as results of a method.</lz:description>
         <lz:fields>
            <lz:field name="Ref" type="Varchar" size="255" />
            <lz:field name="Alias" type="Varchar" size="255" />
            <lz:field name="PKField" type="Varchar" size="255" />
            <lz:field name="FKField" type="Varchar" size="255" />
            <lz:field name="Required" type="Bit" required="true" default="false" />
         </lz:fields>
         <lz:collections>
            <lz:collection name="Fields" object="Result" />
         </lz:collections>
      </lz:object>

      <lz:object name="Result" alias="method-result">
         <lz:description>Defines the values to be returned as the result of a method.</lz:description>
         <lz:fields>
            <lz:field name="Field" type="Varchar" size="255" />
            <lz:field name="Alias" type="Varchar" size="255" />
            <lz:field name="Type" type="Varchar" size="255" />
            <lz:field name="DBName" type="Varchar" size="255" />
            <lz:field name="Size" type="Int" />
            <lz:field name="Scale" type="Int" />
         </lz:fields>
      </lz:object>

      <lz:object name="EffectObjectRef" alias="object-ref" title-field="Name">
         <lz:description>Defines the objects to be affected by a CREATE, UPDATE or CUSTOM method.</lz:description>
         <lz:fields>
            <lz:field name="EffectType" type="Varchar" size="255">
               <lz:description>Defines the type of effect being performed on the object.  For CUSTOM methods, this may be 'Create' or 'Update'.</lz:description>
            </lz:field>
            <lz:field name="Ref" type="Varchar" size="255" />
            <lz:field name="Alias" type="Varchar" size="255" />
            <lz:field name="PKField" type="Varchar" size="255" />
            <lz:field name="FKField" type="Varchar" size="255" />
         </lz:fields>
         <lz:collections>
            <lz:collection name="Filters" alias="method-filters" object="Filter" />
            <lz:collection name="Fields" object="Effect" />
         </lz:collections>
      </lz:object>

      <lz:object name="Effect" alias="method-effect">
         <lz:description>Defines affected fields, and associated parameters, in CREATE, UPDATE and CUSTOM methods.</lz:description>
         <lz:fields>
            <lz:field name="Field" type="Varchar" size="255" />
            <lz:field name="Type" type="Varchar" size="255" />
            <lz:field name="DBType" type="Varchar" size="255" />
            <lz:field name="DBName" type="Varchar" size="255" />
            <lz:field name="Param" type="Varchar" size="255" />
            <lz:field name="AutoGenerate" type="Bit" />
         </lz:fields>
      </lz:object>

      <lz:object name="Filter" alias="method-filter">
         <lz:description>Defines any filters to be applied to the method processing.</lz:description>
         <lz:fields>
            <lz:field name="Field" type="Varchar" size="255" />
            <lz:field name="Param" type="Varchar" size="255" />
            <lz:field name="Value" type="Varchar" size="255" />
         </lz:fields>
      </lz:object>
      <!-- End Method System -->

      <!-- Business View System -->
      <lz:object name="BusinessView" alias="businessview">
         <lz:description>Defines a contextual view of a single entity within the data definition.</lz:description>
         <lz:fields>
            <lz:field name="Context" type="Varchar" size="255" />
         </lz:fields>
         <lz:collections>
            <lz:collection name="DataTables" object="DataTable" />
            <lz:collection name="Relationships" object="Relation" />
         </lz:collections>
      </lz:object>

      <lz:object name="DataTable" alias="datatable">
         <lz:description>Defines a Data Table within a Business View, bound to a single data entity.</lz:description>
         <lz:fields>
            <lz:field name="Ref" type="Varchar" size="255" />
            <lz:field name="Type" type="Varchar" size="255" />
         </lz:fields>
         <lz:collections>
            <lz:collection name="Columns" object="DataColumn" />
         </lz:collections>
      </lz:object>

      <lz:object name="DataColumn" alias="column">
         <lz:description>Defines a Data Column within a Data Table, bound to a single entity field.</lz:description>
         <lz:fields>
            <lz:field name="Alias" type="Varchar" size="255" />
            <lz:field name="AutoGenerate" type="Bit" />
            <lz:field name="DataType" alias="type" type="Varchar" size="255" />
            <lz:field name="DefaultValue" alias="default" type="Varchar" size="255" />
            <lz:field name="FriendlyName" alias="friendly-name" type="Varchar" size="255" />
            <lz:field name="ReadOnly" type="Bit" />
            <lz:field name="Required" type="Bit" />
            <lz:field name="Scale" type="Int" />
            <lz:field name="Size" type="Int" />
            <lz:field name="TableOnly" type="Bit" />
            <lz:field name="LogicalName" alias="logical-name" type="Varchar" size="255" />
            <lz:field name="DBName" type="Varchar" size="255" />
            <lz:field name="DBType" type="Varchar" size="255" />
         </lz:fields>
      </lz:object>

      <lz:object name="Relation" alias="relation">
         <lz:description>Defines a Relationship between two Data Tables.</lz:description>
         <lz:fields>
            <lz:field name="Source">
               <lz:indexes>
                  <lz:index type="Foreign" object="RelationReference" />
               </lz:indexes>
            </lz:field>
            <lz:field name="Target">
               <lz:indexes>
                  <lz:index type="Foreign" object="RelationReference" />
               </lz:indexes>
            </lz:field>
         </lz:fields>
      </lz:object>

      <lz:object name="RelationReference" alias="relationreference">
         <lz:description>Defines an entity reference within a relationship.</lz:description>
         <lz:fields>
            <lz:field name="Ref" type="Varchar" size="255" />
            <lz:field name="Cardinality" type="Varchar" size="255" />
         </lz:fields>
      </lz:object>
      <!-- End Business View System -->

   </lz:objects>

</lz:project>